import router from '@/router'
import type { Menu } from '@/router/type'

export function saveRoutes() {
  let routes: any = router.options.routes[0].children
  const routeIndex = routes?.findIndex((v: Menu) => v.name === 'login')
  routes = routes?.toSpliced(routeIndex, 1) // 删除login，保留原数组
  sessionStorage.setItem('menu', JSON.stringify(routes))
}
